<?php

namespace app\models;

use Yii;

/**
 * This is the model class for table "{{%log}}".
 *
 * @property integer $id
 * @property integer $user_type
 * @property integer $user_id
 * @property string $user_name
 * @property string $model
 * @property string $tag
 * @property string $properties
 * @property string $old_properties
 * @property string $updated_fields
 * @property string $action
 * @property string $request_ip
 * @property string $last_update
 */
class Log extends \yii\db\ActiveRecord
{
    /**
     * @inheritdoc
     */
    public static function tableName()
    {
        return '{{%log}}';
    }

    /**
     * @inheritdoc
     */
    public function rules()
    {
        return [
            [['user_type', 'user_id'], 'integer'],
            [['user_id', 'user_name', 'model', 'tag', 'properties', 'updated_fields', 'action', 'request_ip'], 'required'],
            [['properties', 'old_properties', 'updated_fields'], 'string'],
            [['last_update'], 'safe'],
            [['user_name', 'model', 'tag'], 'string', 'max' => 40],
            [['action'], 'string', 'max' => 64],
            [['request_ip'], 'string', 'max' => 15]
        ];
    }

    /**
     * @inheritdoc
     */
    public function attributeLabels()
    {
        return [
            'id' => 'ID',
            'user_type' => 'User Type',
            'user_id' => 'User ID',
            'user_name' => 'User Name',
            'model' => 'Model',
            'tag' => 'Tag',
            'properties' => 'Properties',
            'old_properties' => 'Old Properties',
            'updated_fields' => 'Updated Fields',
            'action' => 'Action',
            'request_ip' => 'Request Ip',
            'last_update' => 'Last Update',
        ];
    }
}
